import java.util.Locale;

import org.joda.time.DateTime;
import org.joda.time.Days;
import org.joda.time.LocalDate;

public class JodaTime {

	public static void main(String[] args) {
		LocalDate day = new LocalDate(2008, 12, 5);
		System.out.println(day.getYear());
		System.out.println(day.monthOfYear().getAsText(Locale.ENGLISH));
		System.out.println(day.dayOfWeek().getAsText());

		System.out.println();
		LocalDate newYear = day.plusYears(1).withDayOfYear(1);
		Days daysToNewYear = Days.daysBetween(day, newYear);
		System.out.print("Days left from \"" + day + "\" to New Year \""
				+ newYear + "\": ");
		System.out.println(daysToNewYear.getDays());

		DateTime datetime = new DateTime(2008, 12, 6, 14, 37, 0, 0);
		System.out.println(datetime.toString("dd.MM.yyyy, HH:mm:ss"));
		System.out.println(datetime.isAfterNow());
		System.out.println(datetime.isBefore(day.getValue(0)));
		System.out.println(datetime.dayOfWeek().getAsText());

	}

}
